home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / disk / bakup / SortCopy.lha / SortCopy / SortCopyGUI.rexx < prev    next >
OS/2 REXX Batch file  |  1999-12-23  |  15KB  |  456 lines

  1. /*
  2.   $VER: SortCopyGUI.rexx v1.0 (1.12.99) Copyright (c) Nils Görs.
  3. */
  4.  
  5. LeftBorder   = 10    /*Abstand linker Rand    */
  6. TopBorder    = 300   /*Abstand vom oberen Rand*/
  7. OutPutWidth  = 640   /*Breite des Fensters    */
  8. OutPutHeight = 150   /*Höhe des Fensters      */
  9.  
  10. Prefsfile = "ENVARC:SortCopyGUI.prefs"        /* where to save the prefs file */
  11.  
  12. OPTIONS RESULTS
  13. parse source . . called .
  14. PARSE ARG PubScreen
  15. IF PubScreen = "" THEN PubScreen = "Workbench"
  16.  
  17. call _InitAll()
  18. call BuildGUI()
  19.  
  20. Loop:
  21. do while ~eof(ca)
  22. call topipe('con')
  23. in= readln(ca)
  24.  
  25. /*listviews need five values parsed. For string gadgets you want everything after in2 */
  26. parse var in in1 in2 in3 in4 in5 .
  27. parse var in . infromstring
  28.     SELECT
  29.         WHEN in1='iconify' then call iconify()
  30.         WHEN in1='gadget' then call gadget()
  31.         WHEN in1='menu' then call menu()
  32.         WHEN in1='close' then EXIT()
  33.         WHEN in1='help' then call help()
  34.         WHEN in1='key' then call close(ptx)
  35.         WHEN in1='app' THEN call app()
  36.     OTHERWISE
  37.         NOP
  38.     END
  39. end
  40. EXIT
  41.  
  42. iconify:
  43. IF in2=1 THEN call topipe('id 0 s 32')        /* iconify   */
  44.      ELSE call topipe('id 0 s 64')        /* uniconify */
  45. RETURN
  46.  
  47. menu:
  48. SELECT
  49.     WHEN in2 = 0 & in3 = 0 THEN HelpFlag = bitxor('1'x,HelpFlag)
  50.     WHEN in2 = 0 & in3 = 2 THEN DO
  51.         call topipe('id 0 s 256')
  52.         requesterdata='`requestchoice "SortCopyGUI Information" "SortCopyGUI 1.0 (29.11.99)*n©1999 by Nils Görs*n<nils@goers.line.org>*n*n
  53. AWNPipe © by William Parker*n<bill@amitrix.com>*n*n
  54. SortCopy © by Thomas Richter*n<thor@einstein.math.tu-berlin.de>" "OK"`'
  55.         CALL ShellResult(requesterdata)
  56.         call topipe('id 0 s 512')
  57.     END
  58.     WHEN in2 = 0 & in3 = 4 THEN DO
  59.         call topipe('id 0 s 256')
  60.         requesterdata='`requestchoice "SortCopyGUI" "Really quit?" "Yes|No" PUBSCREEN='pubscreen'`'
  61.         IF ShellResult(requesterdata) = 1 THEN EXIT
  62.         call topipe('id 0 s 512')
  63.     END
  64.  
  65.     WHEN in2 = 1 & in3 = 0 THEN DO
  66.         call LoadPrefs()
  67.         IF result ~= 5 THEN DO
  68.         call topipe('id 0 s 256')
  69.             call topipe('id' QuietID 's' QuietFlag 'ref')
  70.             call topipe('id' QuieterID 's' QuieterFlag 'ref')
  71.             call topipe('id' SetArchiveID 's' SetArchiveFlag 'ref')
  72.             call topipe('id' NonAOnlyID 's' NonAOnlyFlag 'ref')
  73.             call topipe('id' OverwriteID 's' OverwriteFlag 'ref')
  74.             call topipe('id' LeaveEmptyID 's' LeaveEmptyFlag 'ref')
  75.             call topipe('id' UpdateID 's' UpdateFlag 'ref')
  76.             call topipe('id' DeletecopiedID 's' DeletecopiedFlag 'ref')
  77.             call topipe('id' PurgeOnlyID 's' PurgeOnlyFlag 'ref')
  78.             call topipe('id' PurgeBackupID 's' PurgeBackupFlag 'ref')
  79.             call topipe('id' ForceID 's' ForceFlag 'ref')
  80.             call topipe('id' BufSizeID 'defn=' BufSizeArg 'ref')
  81.         call topipe('id 0 s 512')
  82.         END
  83.     END
  84.     WHEN in2 = 1 & in3 = 1 THEN call SavePrefs()
  85.  
  86.     OTHERWISE
  87.         NOP
  88. END
  89. RETURN
  90.  
  91. gadget:
  92. SELECT
  93.     WHEN in2 = getDestDrawerID THEN DestArg = in4
  94.     WHEN in2 = getfileID THEN DO
  95.         call topipe('id 0 s 256')
  96.         requesterdata='`requestfile TITLE="Select source file"`'
  97.         CALL ShellResult(requesterdata)
  98.         from_shell = result
  99.         IF from_shell ~= "" THEN DO
  100.             call topipe('id 'FromStringID' gt "'from_shell'"')
  101.             fromArg = from_shell
  102.         END
  103.         call topipe('id 0 s 512')
  104.     END
  105.     WHEN in2 = getDrawerID THEN DO
  106.         call topipe('id 0 s 256')
  107.         requesterdata='`requestdevice TITLE="Select source directory"`'
  108.         CALL ShellResult(requesterdata)
  109.         from_shell = result
  110.         IF from_Shell ~= "" THEN DO
  111.             call topipe('id 'FromStringID' gt "'result'"')
  112.             fromArg = from_shell
  113.         END
  114.         call topipe('id 0 s 512')
  115.     END
  116.     WHEN in2 = FromStringID THEN FromArg = in3
  117.     WHEN in2 = ToStringID THEN DestArg = in3
  118.     WHEN in2 = SetDrawerID THEN DO
  119.         call topipe('id 0 s 256')
  120.         requesterdata='`requestdevice TITLE="Select destination directory"`'
  121.         CALL ShellResult(requesterdata)
  122.         from_shell = result
  123.         IF from_Shell ~= "" THEN DO
  124.             call topipe('id 'ToStringID' gt "'result'"')
  125.             DestArg = from_shell
  126.         END
  127.         call topipe('id 0 s 512')
  128.     END
  129.  
  130.     WHEN in2 = QuietID THEN QuietFlag = bitxor('1'x,QuietFlag)
  131.     WHEN in2 = QuieterID THEN QuieterFlag = bitxor('1'x,QuieterFlag)
  132.     WHEN in2 = SetArchiveID THEN SetArchiveFlag = bitxor('1'x,SetArchiveFlag)
  133.     WHEN in2 = NonAOnlyID THEN NonAOnlyFlag = bitxor('1'x,NonAOnlyFlag)
  134.     WHEN in2 = OverwriteID THEN OverwriteFlag = bitxor('1'x,OverwriteFlag)
  135.     WHEN in2 = LeaveEmptyID THEN LeaveEmptyFlag = bitxor('1'x,LeaveEmptyFlag)
  136.     WHEN in2 = UpdateID THEN UpdateFlag = bitxor('1'x,UpdateFlag)
  137.     WHEN in2 = DeletecopiedID THEN DeletecopiedFlag = bitxor('1'x,DeletecopiedFlag)
  138.     WHEN in2 = PurgeOnlyID THEN PurgeOnlyFlag = bitxor('1'x,PurgeOnlyFlag)
  139.     WHEN in2 = PurgeBackupID THEN PurgeBackupFlag = bitxor('1'x,PurgeBackupFlag)
  140.     WHEN in2 = ForceID THEN ForceFlag = bitxor('1'x,ForceFlag)
  141.     WHEN in2 = BufSizeID THEN BufSizeArg = in3
  142.     WHEN in2 = CancelID THEN EXIT()
  143.     WHEN in2 = StartID THEN DO
  144.         IF fromArg = "" | DestArg = "" THEN RETURN
  145.         argument = ""
  146.         IF QuietFlag = 1 THEN argument = argument "QUIET"
  147.         IF QuieterFlag = 1 THEN argument = argument "QUIETER"
  148.         IF SetArchiveFlag = 1 THEN argument = argument "SETARCHIVE"
  149.         IF NonAOnlyFlag = 1 THEN argument = argument "NONAONLY"
  150.         IF OverwriteFlag = 1 THEN argument = argument "OVERWRITE"
  151.         IF LeaveEmptyFlag = 1 THEN argument = argument "LEAVEEMPTY"
  152.         IF UpdateFlag = 1 THEN argument = argument "UPDATE"
  153.         IF DeletecopiedFlag = 1 THEN argument = argument "DELETECOPIED"
  154.         IF PurgeOnlyFlag = 1 THEN argument = argument "PURGEONLY"
  155.         IF PurgeBackupFlag = 1 THEN argument = argument "PURGEBACKUP"
  156.         IF ForceFlag = 1 THEN argument = argument "FORCE"
  157.         IF BufSizeArg = 0 THEN ADDRESS COMMAND "sortCopy FROM="fromArg "TO="DestArg argument
  158.         ELSE DO
  159.             BufSizeArgCmd = BufsizeArg * 1024
  160.             ADDRESS COMMAND "sortCopy FROM="fromArg "TO="DestArg argument "BUFSIZE="BufSizeArgCmd
  161.         END
  162.      END
  163.      OTHERWISE
  164.        NOP
  165. END
  166. RETURN
  167.  
  168. help:
  169. SELECT
  170.     WHEN in2 = getfileID THEN call ShowHelp('GetFile','Select source file.')
  171.     WHEN in2 = getDrawerID THEN call ShowHelp('GetDir','Select source directory.')
  172.     WHEN in2 = FromStringID THEN call ShowHelp('Source','Source specifications.')
  173.     WHEN in2 = ToStringID THEN call ShowHelp('Destination','Destination specifications.')
  174.     WHEN in2 = SetDrawerID THEN call ShowHelp('GetDir','Select destination of the copy operation.')
  175.     WHEN in2 = QuietID THEN call ShowHelp('Quiet','Suppresses printing the file names being*ncopied.')
  176.     WHEN in2 = QuieterID THEN call ShowHelp('Quieter','Suppresses all messages except errors*nand warnings.')
  177.     WHEN in2 = SetArchiveID THEN call ShowHelp('Set Archive','Set the archive bits of the*ncopied files afterwards.')
  178.     WHEN in2 = NonAOnlyID THEN call ShowHelp('Non A Only','Copy only files with the archive*nbit cleared.')
  179.     WHEN in2 = OverwriteID THEN call ShowHelp('Overwrite','Overwrite destination files in*nany case.')
  180.     WHEN in2 = LeaveEmptyID THEN call ShowHelp('Leave Empty','Don''t delete empty directories*nin the destination.')
  181.     WHEN in2 = UpdateID THEN call ShowHelp('Update','Update only files with newer creation*ndate.')
  182.     WHEN in2 = DeletecopiedID THEN call ShowHelp('Delete copied','Delete files after copying them.*nWARNING:This operation is dangerous!')
  183.     WHEN in2 = PurgeOnlyID THEN call ShowHelp('Purge Only','Remove only old files, but do not copy.')
  184.     WHEN in2 = PurgeBackupID THEN call ShowHelp('Purge Backup','Remove old files from the backup.*nREMARK:If even write protected obsolete files should be deleted, specify the*nFORCE option as well.')
  185.     WHEN in2 = ForceID THEN call ShowHelp('Force','Delete also files that are protected from*ndeletion. This option should be used in conjunction with:*nDELETECOPIED, PURGEBACKUP or PURGEONLY.')
  186.     WHEN in2 = BufSizeID THEN call ShowHelp('BufSize','Specify the buffer/chunk size for*nthe asynchronous copy mode.')
  187.     WHEN in2 = -1 THEN DO
  188.         SELECT
  189.             WHEN togglehelp = 1 THEN togglehelp = 0
  190.             WHEN togglehelp = 0 THEN call close(ptx)
  191.         OTHERWISE
  192.             NOP
  193.         END
  194.     END
  195.     OTHERWISE
  196.         call close(ptx)
  197. END
  198. RETURN
  199.  
  200. showHelp:
  201. If HelpFlag = 0 THEN RETURN
  202.  
  203. call close(ptx)        /* close QuickHelp */
  204. call open(ptx,'awnpipe:tbtxt/xc')
  205.  
  206. call writeln(ptx,' v m sw')
  207. call writeln(ptx,'layout b 0 weih 0 minh 4')
  208. call writeln(ptx,'penmap pmd="0|4|0|4|0|0|1|1|0|1|1|1|1|1|1|2|1|1|2|2" trans')
  209. call writeln(ptx,'image rem weih 0 weiw 0 minw 4 minh 4')
  210. call writeln(ptx,'penmap pmd="0|1|0|4|1|1|2|2"  trans')
  211. call writeln(ptx,'image')
  212. call writeln(ptx,'penmap pmd="0|4|0|4|1|1|0|0|1|1|1|0|2|1|1|1|2|2|1|1" trans')
  213. call writeln(ptx,'image rem weih 0 weiw 0 minw 4 minh 4')
  214. call writeln(ptx,'le')
  215. call writeln(ptx,'layout b 0  tags "8500701E|2|8500701D|1|0"')
  216. call writeln(ptx,'penmap pmd="0|4|0|1|1|1|2|2"  trans')
  217. call writeln(ptx,'image weiw 0 minw 4')
  218. call writeln(ptx,'label gt "Quick Help for -'arg(1)'-*n'arg(2)'"')
  219. call writeln(ptx,'penmap pmd="0|4|0|1|2|2|1|1"  trans')
  220. call writeln(ptx,'image weiw 0 minw 4')
  221. call writeln(ptx,'le')
  222. call writeln(ptx,'layout b 0')
  223. call writeln(ptx,'penmap pmd="0|4|0|4|1|1|2|2|1|1|1|2|0|1|1|1|0|0|1|1" trans')
  224. call writeln(ptx,'image rem weih 0 weiw 0 minw 4 minh 4')
  225. call writeln(ptx,'penmap pmd="0|1|0|4|2|2|1|1|"  trans')
  226. call writeln(ptx,'image weih 0 minh 4')
  227. call writeln(ptx,'penmap pmd="0|4|0|4|2|2|1|1|2|1|1|1|1|1|1|0|1|1|0|0" trans')
  228. call writeln(ptx,'image rem weih 0 weiw 0 minw 4 minh 4')
  229. call writeln(ptx,'le')
  230. call writeln(ptx,'open')
  231.  
  232. toggleHelp = 1
  233. return(0)
  234.  
  235. app:
  236.  
  237. droppedname = "'"||STRIP(infromstring)||"'"
  238.  
  239. call topipe('id 0 s 256')
  240. requesterdata='`requestchoice "SortCopyGUI Info" "'droppedname' was dropped*nShould it be used as source or destination?" "Source|Dest|none"`'
  241. CALL ShellResult(requesterdata)
  242. droppedname  = STRIP(droppedname,,"'")
  243.  
  244.     SELECT
  245.         WHEN result = 1 THEN DO
  246.             call topipe('id' FromStringID 'gt' droppedname)
  247.             fromArg = '"'||droppedname||'"'
  248.         END
  249.         WHEN result = 2 THEN DO
  250.             call topipe('id' ToStringID 'gt' '"'||droppedname||'"')
  251.             DestArg = '"'||droppedname||'"'
  252.         END
  253.     OTHERWISE
  254.         NOP
  255.     END
  256. call topipe('id 0 s 512')
  257. RETURN
  258.  
  259. _InitAll:
  260. IF ~show('L','rexxsupport.library') THEN
  261. IF ~addlib('rexxsupport.library',0,-30,0) THEN
  262. exit(20)
  263.  
  264. /* Version check */
  265. ca = "SCGui"
  266.  
  267. IF SHOWLIST('H', 'AWNPIPE') THEN res=open(ca,"awnpipe:SortCopyGUI/-2022/xc")
  268.     if res ~= 1 then do
  269.         requesterdata='`requestchoice "SortCopyGUI Error" "To use this program you need AWNPipe:*n        (Vers 2.22 or newer). " "OK"`'
  270.         CALL ShellResult(requesterdata)
  271.         exit
  272.     end
  273. NL = '0a'x
  274.  
  275. HelpFlag = 0
  276. call LoadPrefs()
  277.  
  278. FromArg = ""
  279. DestArg = ""
  280. /**********************************
  281. *** Standard-Output umlenken ;) ***
  282. ***********************************/
  283. ScreenOutPut = 'CON:'LeftBorder'/'TopBorder'/'OutPutWidth'/'OutPutHeight'/SortCopyGUI/AUTO/CLOSE/SCREEN'PubScreen
  284.  
  285. CALL CLOSE('STDOUT')
  286. IF ~OPEN('STDOUT',ScreenOutPut,'W') THEN
  287.    EXIT(10)
  288.  
  289. CALL CLOSE('STDIN')
  290. CALL OPEN('STDIN','*','W')
  291. CALL PRAGMA('*','STDOUT')
  292. CALL PRAGMA('*','STDIN')
  293. RETURN
  294.  
  295. BuildGUI:
  296. call topipe('title "SortCopy GUI" app help m a db dg v cg ig sg si so sendkeys Icontitle=SortCopyGUI ii "'called'" pubscreen='pubscreen)
  297. call topipe('menu gt="Project|@H^%QuickHelp|-|@?About|-|@QQuit"')
  298. call topipe('menu gt="Edit|@LLast saved|@SSave Settings"')
  299.  
  300. call topipe('layout v noms si so labl b=7 gt="Source and Dest" weih=0')
  301.     call topipe('layout chl bj b=0')
  302.         call topipe('label gt="_From:" ua')
  303.         FromStringID=topipe('string tc lj chl')
  304.         getfileID=topipe('button ab=0 weiw 0 weih 0')
  305.         getDrawerID=topipe('button ab=1 weiw 0 weih 0')
  306.     call topipe('le')
  307. call topipe('space')
  308.     call topipe('layout chl bj b=0')
  309.         call topipe('label gt="_To:" ua')
  310.         ToStringID=topipe('string tc lj chl')
  311.         SetDrawerID=topipe('button ab=1 weiw 0 weih 0')
  312.     call topipe('le')
  313. call topipe('le')
  314.  
  315. call topipe('layout v e noms si so labl b=7 gt="Options" weih=0')
  316.     call topipe('layout hori so b=0')
  317.     QuietID=topipe('checkbox gt "_Quiet" s 'QuietFlag)
  318.     QuieterID=topipe('checkbox gt "Qui_eter" s 'QuieterFlag)
  319.     call topipe('le')
  320.     call topipe('layout hori so b=0')
  321.     SetArchiveID=topipe('checkbox gt "Setarchi_ve" s 'SetArchiveFlag)
  322.     NonAOnlyID=topipe('checkbox gt "_NonAOnly" s 'NonAOnlyFlag)
  323.     call topipe('le')
  324.     call topipe('layout hori so b=0')
  325.     OverwriteID=topipe('checkbox gt "_Overwrite" s 'OverwriteFlag)
  326.     LeaveEmptyID=topipe('checkbox gt "_LeaveEmpty" s 'LeaveEmptyFlag)
  327.     call topipe('le')
  328.     call topipe('layout hori so b=0')
  329.     UpdateID=topipe('checkbox gt "_Update" s 'UpdateFlag)
  330.     DeletecopiedID=topipe('checkbox gt "_Deletecopied" s 'DeletecopiedFlag)
  331.     call topipe('le')
  332.     call topipe('layout hori so b=0')
  333.     PurgeOnlyID=topipe('checkbox gt "_PurgeOnly" s 'PurgeOnlyFlag)
  334.     PurgeBackupID=topipe('checkbox gt "Purge_Backup" s 'PurgeBackupFlag)
  335.     call topipe('le')
  336.     call topipe('layout hori so b=0')
  337.     ForceID=topipe('checkbox gt "Fo_rce" s 'ForceFlag)
  338.     call topipe('le')
  339. call topipe('le')
  340.  
  341. call topipe('layout sw bj b=0')
  342. call topipe('label gt="BufSize:"')
  343. BufSizeID=topipe('integer tc lj arrows minn=0 maxn=2000 maxc=4 weiw=0 defn= 'BufSizeArg)
  344. call topipe('label gt=" KB"')
  345. call topipe('le')
  346.  
  347. call topipe('layout b=0 v si so weih 0')
  348. call topipe('button b=7 minh 2')
  349. call topipe('le')
  350.  
  351. call topipe('layout b=0 h si so weih 0')
  352. StartID=topipe('button gt "_Start"')
  353. call topipe('space')
  354. CancelID=topipe('button gt "_Cancel"')
  355. call topipe('le')
  356. call topipe('open')
  357. RETURN
  358.  
  359. topipe:
  360. /* this routine does error checking on lines written to pipe.*/
  361. /*get line to output*/
  362. parse arg out
  363.  
  364. /* write to the pipe*/
  365. call writeln(ca,out)
  366.  
  367. /*get responce and parse it.*/
  368. in=readln(ca)
  369. parse var in res1 res2 .
  370.  
  371. /* if all is ok return the second part of the responce (usualy the GID)*/
  372. if res1='ok' then return(res2)
  373.  
  374. /* something went wrong, we notify the user then exit */
  375. /*show problem line and responce (reponce may be just a blank line)*/
  376. say 'error from: 'out
  377. say '  responce: ' in
  378. exit
  379.  
  380. ShellResult:
  381. PARSE ARG ShellCmd
  382. cmdid='req'pragma('id')
  383. address command 'rxset' cmdid Shellcmd
  384. from_Shell=getclip(cmdid)
  385. call setclip(cmdid,'')
  386. RETURN(from_Shell)
  387.  
  388. /* Load and Save Prefs */
  389. LoadPrefs:
  390. IF OPEN(file,Prefsfile,R) = 0 THEN DO
  391.     QuietFlag = 0
  392.     QuieterFlag = 0
  393.     SetArchiveFlag = 0
  394.     NonAOnlyFlag  = 0
  395.     OverwriteFlag = 0
  396.     LeaveEmptyFlag = 0
  397.     UpdateFlag = 0
  398.     DeletecopiedFlag = 0
  399.     PurgeOnlyFlag = 0
  400.     PurgeBackupFlag = 0
  401.     ForceFlag = 0
  402.     BufSizeArg = 0
  403.     CALL CLOSE(file)
  404.     RETURN(5)
  405. END
  406. ELSE DO
  407. i = 1
  408.     DO WHILE ~EOF(file)
  409.         flag.i = READLN(file)
  410.         i = i + 1
  411.     END
  412.     QuietFlag = flag.1
  413.     QuieterFlag = flag.2
  414.     SetArchiveFlag = flag.3
  415.     NonAOnlyFlag  = flag.4
  416.     OverwriteFlag = flag.5
  417.     LeaveEmptyFlag = flag.6
  418.     UpdateFlag = flag.7
  419.     DeletecopiedFlag = flag.8
  420.     PurgeOnlyFlag = flag.9
  421.     PurgeBackupFlag = flag.10
  422.     ForceFlag = flag.11
  423.     BufSizeArg = flag.12
  424. END
  425. CALL CLOSE(file)
  426. RETURN(0)
  427.  
  428. SavePrefs:
  429. call OPEN(file,Prefsfile,W)
  430. IF QuietFlag = 1 THEN CALL WRITELN(file,"1")
  431.         ELSE CALL WRITELN(file,"0")
  432. IF QuieterFlag = 1 THEN CALL WRITELN(file,"1")
  433.         ELSE CALL WRITELN(file,"0")
  434. IF SetArchiveFlag = 1 THEN CALL WRITELN(file,"1")
  435.         ELSE CALL WRITELN(file,"0")
  436. IF NonAOnlyFlag = 1 THEN CALL WRITELN(file,"1")
  437.         ELSE CALL WRITELN(file,"0")
  438. IF OverwriteFlag = 1 THEN CALL WRITELN(file,"1")
  439.         ELSE CALL WRITELN(file,"0")
  440. IF LeaveEmptyFlag = 1 THEN CALL WRITELN(file,"1")
  441.         ELSE CALL WRITELN(file,"0")
  442. IF UpdateFlag = 1 THEN CALL WRITELN(file,"1")
  443.         ELSE CALL WRITELN(file,"0")
  444. IF DeletecopiedFlag = 1 THEN CALL WRITELN(file,"1")
  445.         ELSE CALL WRITELN(file,"0")
  446. IF PurgeOnlyFlag = 1 THEN CALL WRITELN(file,"1")
  447.         ELSE CALL WRITELN(file,"0")
  448. IF PurgeBackupFlag = 1 THEN CALL WRITELN(file,"1")
  449.         ELSE CALL WRITELN(file,"0")
  450. IF ForceFlag = 1 THEN CALL WRITELN(file,"1")
  451.         ELSE CALL WRITELN(file,"0")
  452. IF BufSizeArg = 0 THEN CALL WRITELN(file,"0")
  453.         ELSE CALL WRITELN(file,BufSizeArg)
  454. CALL CLOSE(file)
  455. RETURN
  456.